package data;

import java.util.HashMap;
import java.util.Map;

import com.itany.ums.constant.RoleEnum;
import com.itany.ums.constant.StateEnum;
import com.itany.ums.entity.User;

public class Database {

	public static Map<Long, User> users;
	public static long id = 1;

	static {
		User u1 = new User(id++, "alice", "123456", "13000000001", "alice@user.com", RoleEnum.ADMIN.getRoleCode(), StateEnum.ENABLE.getStateCode());
		User u2 = new User(id++, "tom", "123456", "13000000002", "tom@user.com", RoleEnum.NORMAL.getRoleCode(), StateEnum.ENABLE.getStateCode());
		User u3 = new User(id++, "monica", "123456", "13000000003", "monica@user.com", RoleEnum.NORMAL.getRoleCode(), StateEnum.ENABLE.getStateCode());
		User u4 = new User(id++, "angelina", "123456", "13000000001", "alice@user.com", RoleEnum.NORMAL.getRoleCode(), StateEnum.DISABLE.getStateCode());

		users = new HashMap<Long, User>() {
			{
				put(u1.getId(), u1);
				put(u2.getId(), u2);
				put(u3.getId(), u3);
				put(u4.getId(), u4);
			}
		};

	}
}
